<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
    	<label class="control-label  col-sm-1">{:__('Code')}:</label>
        <div class="col-xs-12 col-sm-2">
        	<input id="c-code_date" class="form-control" type="text" value="{$row.code}" readonly>
        </div>
        <label class="control-label  col-sm-1">{:__('Code_date')}:</label>
        <div class="col-xs-12 col-sm-2">
            <input id="c-code_date" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[code_date]" type="text" value="{$row.code_date}">
        </div>
        <label class="control-label col-xs-12 col-sm-1">{:__('Book_date')}:</label>
        <div class="col-xs-12 col-sm-2">
            <input id="c-book_date" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[book_date]" type="text" value="{$row.book_date}">
        </div>
        <label class="control-label col-xs-12 col-sm-1">{:__('Warehouse_id')}:</label>
        <div class="col-xs-12 col-sm-2">
        	{:build_select('row[warehouse_id]',$warehouseArr,$row.warehouse_id,['id'=>'c-warehouse_id','readonly'=>'true'])}
        </div>
    </div>
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-1">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-2">
            {:build_select('row[type]',$typeArr,$row.type,['id' => 'type','readonly'=>'true'])}
        </div>
        
    <span class="hidden" data-favisible="type=2">
    	<label class="control-label col-xs-12 col-sm-1">{:__('Inv_number_start')}:</label>
        <div class="col-xs-1 col-sm-2">
            <input id="inv_number_start" class="form-control" name="row[inv_number_start]" type="text" readonly>
        </div>
        <label class="control-label col-xs-12 col-sm-1">{:__('Inv_number_end')}:</label>
        <div class="col-xs-12 col-sm-2">
            <input id="inv_number_end" class="form-control" name="row[inv_number_end]" type="text" readonly>
        </div>
    </span>
    
    <div class="form-group hidden" data-favisible="type=3">
        <label class="control-label col-xs-12 col-sm-1">{:__('Shelves_ids')}:</label>
        <div class="col-xs-12 col-sm-6">
            <input class="form-control" data-role='tagsinput' type="text" data-tagsinput-options='{"trimValue":true,"delimiter":"|"}' value="{$row.shelves_text}" readonly>
        </div>
        
    </div>
    
    
    <div class=" hidden" data-favisible="type=4">
        <label class="control-label col-xs-12 col-sm-1">{:__('Inv_class')}:</label>
        <div class="col-xs-12 col-sm-3">
        <input class="form-control"  type="text" value='{$row.inv_class_name}' readonly>
        </div>
    </div>
    
    </div>
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-1">{:__('Pda_flag')}</label>
        <div class="col-xs-12 col-sm-2">
        	{:build_select('row[pda][]',$pdaFlagArr,$row.pda,['class' => 'form-control selectpicker', 'multiple' =>'','data-actions-box'=>'true' ])}
        </div>
        
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-2">
        	{:build_select('row[status]',$statusArr,$row.status)}
        </div>
        <div class=" hidden" data-favisible="type=3">
        <label class="control-label col-xs-12 col-sm-1">{:__('Shelves_des')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input class="form-control" type="text" value="{$row.shelves_des}">
        </div>
    	</div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-1">{:__('Remark')}:</label>
        <div class="col-xs-12 col-sm-11">
        	<input class="form-control " name="row[remark]" type="text" value="{$row.remark}">
        </div>
    </div>

<!--    <table id="edit_table" class="table table-striped table-bordered table-hover table-nowrap"width="100%">-->
<!--    </table>-->
    <div style="white-space: nowrap;overflow-x: auto;width:100%;min-height:400px">
        <table class="table fieldlist table-nowrap" data-template="basictpl" id="free-programme-item-table" data-name="row[basic]">
            <tr class="table-bordered">
                <td class="text-center table-bordered" width="100">{:__('物料编码')}</td>
                <td class="text-center table-bordered" width="200">{:__('物料名称')}</td>
                <td class="text-center table-bordered" width="100">{:__('批号')}</td>
                <td class="text-center table-bordered" width="100">{:__('存放路径')}</td>
                <td class="text-center table-bordered" width="100">{:__('账面数量')}</td>
                <td class="text-center table-bordered" width="100">{:__('实时库存')}</td>
                <td class="text-center table-bordered" width="100">{:__('盘点数量')}</td>
                <td class="text-center table-bordered" width="120">{:__('盘点时间')}</td>
                <td class="text-center table-bordered"  width="100">{:__('期间入库')}</td>
        		<td class="text-center table-bordered" width="100">{:__('期间出库')}</td>
                <td class="text-center table-bordered" width="100">{:__('盘盈入库')}</td>
                <td class="text-center table-bordered" width="100">{:__('盘亏出库')}</td>
                <td class="text-center table-bordered" width="100">{:__('扫描状态')}</td>
                <td class="text-center table-bordered" width="100">{:__('异常原因')}</td>
                <!-- <td class="text-center table-bordered" width="40">{:__('操作')}</td> -->
            </tr>
        </table>
    </div>
    <textarea name="row[basic]" id="c-basic-textarea" class="form-control hidden" cols="30" rows="5">{$list_json}</textarea>
    <script id="basictpl" type="text/html">
        <tr class="table-bordered" id="tr_<%=index%>">
            <td class="text-center table-bordered">
                <%=value?value['cInvCode']:''%>
                <input type="hidden" name="<%=name%>[<%=index%>][id]" id="input_id_<%=index%>" value="<%=value?value['id']:''%>"/></td>
            	<input type="hidden" name="<%=name%>[<%=index%>][cInvCode]" id="input_cInvCode_<%=index%>" class="form-control table-input " value="<%=value?value['cInvCode']:''%>"/></td>
            </td>
            <td class="text-center table-bordered"><%=value?value['name']:''%></td>
            <td class="text-center table-bordered"><%=value?value['cBatch']:''%></td>
			<td class="text-center table-bordered"><%=value?value['shelves_name']:''%></td>
			<td class="text-center table-bordered"><%=value?value['iQuantity']:''%></td>
			<td class="text-center table-bordered"><%=value?value['kc_quantity']:''%></td>
			<td class="text-center table-bordered">
<input type=number style="width:100px;"  name="<%=name%>[<%=index%>][iCVCQuantity]"  value="<%=value?value['iCVCQuantity']:''%>" class="form-control">
</td>
<td class="text-center table-bordered">
<input type="text" name="<%=name%>[<%=index%>][scantime]" data-use-current="true"
				data-date-format="YYYY-MM-DD HH:mm:ss" data-rule="" class="form-control datetimepicker_top" 
				style="width:150px;" value="<%=value?value['scantime']:''%>" />
</td>
			<td class="text-center table-bordered"><%=value?value['duringIn']:''%></td>
			<td class="text-center table-bordered"><%=value?value['duringOut']:''%></td>
            <td class="text-center table-bordered"><%=value?value['iAdInQuantity']:''%></td>
            <td class="text-center table-bordered"><%=value?value['iAdOutQuantity']:''%></td>
			
			<td class="text-center table-bordered"><%=value?value['scan_flag_text']:''%></td>
			<td class="text-center table-bordered"><%=value?value['result']:''%></td>
            <td><span class="btn btn-sm btn-danger btn-remove-tip" onclick=toDeleteCkItem(<%=index%>)><i class="fa fa-times"></i></span></td>
        </tr>
    </script>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>